const fs = require('fs')
const path = require('path')
// 逐行读取 以流的方式读取
const readline = require('readline')

// 日志路径
const logpath = path.join(__dirname, 'data', 'access.log')

// 此文件使用逐行读取方式读取
const line = readline.createInterface({
  input: fs.createReadStream(logpath)
});

// 监听文件流到行尾时触发
line.on('line', data => {
  console.log('aaa ---' +data);
})


